package cn.edu.hqu.cst.crj.eventmechanism;

import android.view.View;
import android.view.View.OnClickListener;
import android.app.Activity;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;


public class Claculator extends AppCompatActivity implements OnClickListener { ;
    private Activity activity;
    TextView text;

    public Claculator(Activity activity,TextView headtext){
        this.activity = activity;
        text=headtext;
       // headtext.setText("外部类作为监听器");
    }

    @Override
    public void onClick(View v) {
         text.setText("外部类作为监听器");
        //Toast.makeText(activity,"使用外部类作为监听器",Toast.LENGTH_SHORT).show();
    }
}
